package cq.zhcqk.util;

import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;

import cq.zhcqk.R;

/**
 * Created by zhangle on 2017/5/22.
 */
public class ImageLoaderHelper {

    public static DisplayImageOptions getOptions(){
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .showImageOnLoading(R.mipmap.defaut_pr)
                .showImageOnFail(R.mipmap.defaut_pr)
                .showImageForEmptyUri(R.mipmap.defaut_pr)
                .build();
        return options;
    }

    public static DisplayImageOptions getOptionsDf(){
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .showImageOnLoading(R.mipmap.defaut_pr)
                .showImageOnFail(R.mipmap.defaut_pr)
                .showImageForEmptyUri(R.mipmap.defaut_pr)
                .build();
        return options;
    }

    public static DisplayImageOptions getOptionsDfBig(){
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .imageScaleType(ImageScaleType.NONE)
                .showImageOnLoading(R.mipmap.defaut_pr)
                .showImageOnFail(R.mipmap.defaut_pr)
                .showImageForEmptyUri(R.mipmap.defaut_pr)
                .build();
        return options;
    }

    public static DisplayImageOptions getOptionsHead(){
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .considerExifParams(true)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .imageScaleType(ImageScaleType.NONE)
                .showImageOnLoading(R.mipmap.mrtx)
                .showImageOnFail(R.mipmap.mrtx)
                .showImageForEmptyUri(R.mipmap.mrtx)
                .build();
        return options;
    }
}
